<?php
namespace app\api\controller\mall;

use app\api\controller\AuthBase;
use app\common\business\Cart as cartBusi;
use app\common\lib\Show;
// API
class Init extends AuthBase
{
	//获取购物车商品数量
	public function index(){
		if(!$this->request->isPost()){
			return Show::error();
		}

		$count = (new cartBusi())->getCount($this->userId);
		$result = [
			'cart_num' => $count,
		];
		
		return Show::success($result);
	}
}